home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1883 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: clri6a.gsi.de!kraemer
  2. From: kraemer@clri6a.gsi.de (Michael Kraemer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: More linked list nonsense
  5. Date: 24 Jan 1996 17:54:44 GMT
  6. Organization: Technische Hochschule Darmstadt
  7. Message-ID: <4e5rp4$tub@rs18.hrz.th-darmstadt.de>
  8. References: <4e5nih$iib@news.sdd.hp.com>
  9. NNTP-Posting-Host: clri6a.gsi.de
  10.  
  11. In article <4e5nih$iib@news.sdd.hp.com>, Jeff Grimmett <jgrimm@sdd.hp.com> writes:
  12. > Howdy,
  13. > It just occurred to me last night, as I pored over steaming code, that 
  14. > the function Remove() (used to remove nodes from linked lists) might 
  15. > POSSIBLY not be freeing the memory allocated to the node it is removing. 
  16. > Does anyone have some insight on this?  It's difficult to deallocate a 
  17. > node once it's not part of the list, but it's pretty STUPID to free it 
  18. > BEFORE. :-)
  19. > It's also hard to imagine that C= gave us this function without some way 
  20. > to clean up behind it, but I'm SUCH a Doubting Thomas at times... :-)
  21. > Any info appreciated.  Otherwise, I'm going to proceed on the assumtion 
  22. > it's safe.  It appears to be.
  23.  
  24.    struct Node *pln;
  25.  
  26.    Remove(pln);         /* remove it from the list */
  27.    free(pln);           /* remove it from memory */
  28.